# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
  
  def seconds_to_time(seconds)
    
    hours = seconds/(60*60)
    minutes = seconds/(60) - hours*60
    seconds = seconds - hours*60*60 - minutes*60
    
    
    html =(hours<10 ? "0": "") + hours.to_s+":"+(minutes<10 ? "0":"")+minutes.to_s+":"+(seconds<10 ? "0" : "")+seconds.to_s
  end
  
  def image_url(source) 
    abs_path = image_path(source) 
    unless abs_path =~ /\Ahttp/ 
      abs_path = "http://#{request.host_with_port}#{abs_path}" 
    end 
    abs_path 
  end 
end
